package com.framework.auth.context;

import java.util.Map;

public class LoginContext {

    private static final ThreadLocal<Map<String, Object>> loginContext = ThreadLocal.withInitial(() -> null);

    // 获取当前线程的登录信息
    public static Map<String, Object> getLoginInfo() {
        return loginContext.get();
    }

    // 设置当前线程的登录信息
    public static void setLoginInfo(Map<String, Object> loginInfo) {
        loginContext.set(loginInfo);
    }

    // 清除当前线程的登录信息
    public static void clear() {
        loginContext.remove();
    }
}
